
package com.chensq.devops




def podSpec() {
    return '''
apiVersion: v1
kind: Pod
spec:
  containers:
    - args: ['$(JENKINS_SECRET)', '$(JENKINS_NAME)']
      image: 'registry.cn-beijing.aliyuncs.com/chenshengqun/jnlp:alpine'
      name: jnlp
      imagePullPolicy: IfNotPresent
      volumeMounts:
        - mountPath: "/etc/localtime"
          name: "localtime"
          readOnly: false
    - command:
        - "cat"
      env:
        - name: "LANGUAGE"
          value: "en_US:en"
        - name: "LC_ALL"
          value: "en_US.UTF-8"
        - name: "LANG"
          value: "en_US.UTF-8"
      #image: "192.168.31.200/library/build:v1.0.0"
      image: "registry.cn-beijing.aliyuncs.com/chenshengqun/build:v1.0.0"
      imagePullPolicy: "IfNotPresent"
      name: "build"
      tty: true
      volumeMounts:
        - mountPath: "/etc/localtime"
          name: "localtime"
        - mountPath: "/root/go/pkg/"
          name: "gocachedir"
        - mountPath: "/root/.m2/"
          name: "javacachedir"
        - mountPath: "/root/.npm/"
          name: "npmcachedir"
          readOnly: false
    - command:
        - "cat"
      env:
        - name: "LANGUAGE"
          value: "en_US:en"
        - name: "LC_ALL"
          value: "en_US.UTF-8"
        - name: "LANG"
          value: "en_US.UTF-8"
      image: "registry.cn-beijing.aliyuncs.com/chenshengqun/kubectl:self-1.17"
      imagePullPolicy: "IfNotPresent"
      name: "kubectl"
      tty: true
      volumeMounts:
        - mountPath: "/etc/localtime"
          name: "localtime"
          readOnly: false
    - command:
        - "cat"
      env:
        - name: "LANGUAGE"
          value: "en_US:en"
        - name: "LC_ALL"
          value: "en_US.UTF-8"
        - name: "LANG"
          value: "en_US.UTF-8"
      image: "registry.cn-beijing.aliyuncs.com/chenshengqun/tools:1.0.0"
      #image: "192.168.31.200/library/tools:v1.0.3"
      imagePullPolicy: "IfNotPresent"
      name: "docker"
      tty: true
      volumeMounts:
        - mountPath: "/etc/localtime"
          name: "localtime"
          readOnly: false
        - mountPath: "/var/run/docker.sock"
          name: "dockersock"
          readOnly: false
  restartPolicy: "Never"
  nodeSelector:
    build: "true"
  securityContext: {}
  volumes:
    - hostPath:
        path: "/var/run/docker.sock"
      name: "dockersock"
    - hostPath:
        path: "/usr/share/zoneinfo/Asia/Shanghai"
      name: "localtime"
    - name: "gocachedir"
      hostPath:
        path: "/go/gopkg"
    - name: "javacachedir"
      hostPath:
        path: "/opt/m2"
    - name: "npmcachedir"
      hostPath:
        path: "/opt/npm"
'''
}
